#!/bin/bash

if (( $EUID == 0 )); then
  echo "Eseguire lo script come utente non amministratore"
  exit
fi

# installo estensioni per italiano, devcontainer
code --install-extension codezombiech.gitignore
code --install-extension donjayamanne.githistory
code --install-extension ms-azuretools.vscode-containers
code --install-extension ms-ceintl.vscode-language-pack-it
code --install-extension ms-vscode-remote.remote-containers

# se la dir non esiste la creo
DIR=~/.config/Code/User
if [ ! -d "$DIR" ]; then
  mkdir -p "$DIR"
fi

# setto VSCode come preferisco
cat > ~/.config/Code/User/settings.json  << EOF
{
  "editor.minimap.enabled": false,
  "editor.tabSize": 2,
  "editor.detectIndentation": false,
  "editor.insertSpaces": true,
  "files.trimTrailingWhitespace": true,
  "files.trimFinalNewlines": true,
  "workbench.editor.enablePreviewFromQuickOpen": true,
  "workbench.editor.enablePreviewFromCodeNavigation": true,
}
EOF
